const request = require('../../utils/kzj.request.js');
/**
 * 每一个页面对应一个contoller
 */
class controllerM {
  //预约已经支付的订单服务
  agreePayOrder(params) {
    return request.post(`/api/goods/agree/agreePayOrder`, params).then(res => res.data)
  }
  //登陆
  appletGetOpenId(params) {
    return request.post(`/api/account/appletGetOpenId`, params, false).then(res => res.data)
  }

  // 小程序根据code登陆
  appletLogin(params) {
    return request.post(`/api/account/appletLogin`, params, false, false).then(res => res.data)
  }
  // 小程序获取用户信息并绑定手机号登陆
  appletBdMobileLogin(params) {
    return request.post(`/api/account/appletBdMobileLogin`, params, false).then(res => res.data)
  }
  // 根据sessionKey获取openId
  appletGetPhone(params) {
    return request.post(`/api/account/appletGetPhone`, params, false).then(res => res.data)
  }

  // 获取协议
  listByType(params) {
    return request.post(`/api/content/listByType`, params, false).then(res => res.data)
  }
  //  获取我的店铺列表(
  selectMyConsumed(params) {
    return request.post(`/api/shop/selectMyConsumed`, params).then(res => res.data)
  }
  //搜索附近店铺
  nearbyPage(params) {
    return request.post(`/api/shop/nearbyPage`, params, false).then(res => res.data)
  }
  // 提交意见反馈
  suggestadd(params) {
    return request.post(`/api/suggest/add`, params, false).then(res => res.data)
  }
  // 店铺详情页面
  shopDetails(params) {
    return request.post(`/api/shop/shopDetails`, params, false).then(res => res.data)
  }
  // 获取店铺简略信息
  getShop(params) {
    return request.post(`/api/shop/getShop`, params, false).then(res => res.data)
  }
  // 获取店铺页面的轮播图
  shopRotationImg(params) {
    return request.post(`/api/img/shopRotationImgC`, params, false).then(res => res.data)
  }
  // 商品列表
  shopGoodsPage(params) {
    return request.post(`/api/goods/shopGoodsPage`, params, false).then(res => res.data)
  }
  // 店铺首页商品列表
  shopGoodsRecommendPage(params) {
    return request.post(`/api/goods/shopGoodsRecommendPage`, params, false).then(res => res.data)
  }
  // 获取云商品列表
  cloutGoodsPage(params) {
    return request.post(`/api/goods/cloutGoodsPage`, params, false).then(res => res.data)
  }
  // 获取自己的详细信息
  myInformation(params) {
    return request.post(`/api/account/myInformation`, params).then(res => res.data)
  }

  // 获取自己的简略信息
  getAccountRelation(params) {
    return request.post(`/api/account/getAccountRelation`, params).then(res => res.data)
  }
  // 商品详情页
  goodsDetails(params) {
    return request.post(`/api/goods/goodsDetails`, params, false).then(res => res.data)
  }
  // 商品收藏
  controllerGoods(params) {
    return request.post(`/api/goods/collection/controllerGoods`, params).then(res => res.data)
  }
  // 查询商品是否收藏
  goodsIsController(params) {
    return request.post(`/api/goods/collection/goodsIsController`, params).then(res => res.data)
  }

  // 生成单一商品的订单号
  goodsSettlement(params) {
    return request.post(`/api/order/goodsSettlement`, params, true).then(res => res.data)
  }
  // 添加商品到购物车
  addGoods(params) {
    return request.post(`/api/goods/cart/addGoods`, params, true).then(res => res.data)
  }
  // 预约审核服务
  agreeService(params) {
    return request.post(`/api/goods/agree/agreeService`, params, true).then(res => res.data)
  }
  // 获取店铺员工列表 
  shopStaff(params) {
    return request.post(`/api/shop/shopStaff`, params, false).then(res => res.data)
  }

  // 获取分享店铺链接 
  shareShop(params) {
    return request.post(`/api/share/shareShop`, params, false).then(res => res.data)
  }

  // 根据商品对应的正在拼团列表 
  selectByGoodsId(params) {
    return request.post(`/api/market/selectByGoodsId`, params, true).then(res => res.data)
  }

  // 获取商品评论列表 
  goodsCommentPage(params) {
    return request.post(`/api/comment/goodsCommentPage`, params, false).then(res => res.data)
  }

  // 获取购物车列表
  cartList(params) {
    return request.post(`/api/goods/cart/cartList`, params).then(res => res.data)
  }

  // 更新购物车数量
  updateCart(params) {
    return request.post(`/api/goods/cart/updateCart`, params).then(res => res.data)
  }

  // 移除购物车商品
  delGoods(params) {
    return request.post(`/api/goods/cart/delGoods`, params).then(res => res.data)
  }

  // 商品订单余额支付
  balancePay(params) {
    return request.post(`/api/pay/balancePay`, params).then(res => res.data)
  }

  // 根据购物车id生成订单
  cartSettlement(params) {
    return request.post(`/api/order/cartSettlement`, params).then(res => res.data)
  }

  // 生成单一商品的订单号
  goodsSettlement(params) {
    return request.post(`/api/order/goodsSettlement`, params).then(res => res.data)
  }

  // 获取店铺类型列表 
  shopTypeList(params) {
    return request.post(`/api/shop/shopTypeList`, params, false).then(res => res.data)
  }

  // VIP专享 
  memberGoodsPage(params) {
    return request.post(`/api/goods/memberGoodsPage`, params, false).then(res => res.data)
  }

  // 积分商城数据 
  integralpage(params) {
    return request.post(`/api/integral/goods/page`, params, false).then(res => res.data)
  }

  // 积分兑换商品 
  exchange(params) {
    return request.post(`/api/integral/goods/exchange`, params).then(res => res.data)
  }
  // 获取拼团列表 
  marketPage(params) {
    return request.post(`/api/market/marketPage`, params, false).then(res => res.data)
  }

  // 根据商品对应的正在拼团列表 
  marketByGoodsId(params) {
    return request.post(`/api/market/selectByGoodsId`, params, false).then(res => res.data)
  }

  // 拼团商品列表 
  marketGoodsPage(params) {
    return request.post(`/api/goods/marketGoodsPage`, params, false).then(res => res.data)
  }

  // 我的优惠券列表
  myCouponPage(params) {
    return request.post(`/api/coupon/myCouponPage`, params).then(res => res.data)
  }

  // 优惠券详情
  details(params) {
    return request.post(`/api/coupon/details`, params, false).then(res => res.data)
  }

  // 领取赠送优惠券
  receiveGive(params) {
    return request.post(`/api/coupon/receiveGive`, params).then(res => res.data)
  }

  // 领取活动优惠券
  receive(params) {
    return request.post(`/api/coupon/receive`, params).then(res => res.data)
  }

  // 领取活动优惠券
  receive1(params) {
    return request.post(`/api/coupon/receive`, params, true, true, false).then(res => res.data)
  }

  // 获取标签列表
  selectLabel(params) {
    return request.post(`/api/label/selectLabel`, params, false).then(res => res.data)
  }
  // 根据标签获取商品分页信息
  labelGoodsPage(params) {
    return request.post(`/api/goods/labelGoodsPage`, params).then(res => res.data)
  }

  // 购物车商品数量
  cartNum(params) {
    return request.post(`/api/goods/cart/cartNum`, params).then(res => res.data)
  }
  // 支付成功
  paySuccess(params) {
    return request.post(`/api/bug/paySuccess`, params).then(res => res.data)
  }

  // 预约记录详情 
  agreeDetail(params) {
    return request.post(`/api/goods/agree/agreeDetail`, params).then(res => res.data)
  }

  // 活动专区优惠券
  activityPage(params) {
    return request.post(`/api/coupon/activityPage`, params).then(res => res.data)
  }

  // 发起拼团
  createMarket(params) {
    return request.post(`/api/market/createMarket`, params).then(res => res.data)
  }

  // 获取用户可用优惠券列表
  canUseCoupon(params) {
    return request.post(`/api/coupon/canUseCoupon`, params).then(res => res.data)
  }

  // 用户持有优惠券详情
  accountDetails(params) {
    return request.post(`/api/coupon/accountDetails`, params).then(res => res.data)
  }

  // 微信小程序第三方支付
  weChatPay(params) {
    return request.post(`/api/pay/weChatPay`, params).then(res => res.data)
  }

  // 被分享优惠券信息
  accountShareDetails(params) {
    return request.post(`/api/coupon/accountShareDetails`, params, false).then(res => res.data)
  }
  /**
   * 获取系统参数
   * @return {Promise}
   */
  configMessage(params) {
    return request.post(`/api/configure/page`, params, false).then(res => res.data)
  }
  /**
   * 绑定上级
   * @return {Promise}
   */
  invitationPerson(params) {
    return request.post(`/api/shop/invitation`, params).then(res => res.data)
  }

  /**
   * 获取弹窗图片
   * @return {Promise}
   */
  getPoster(params) {
    return request.post(`/api/img/poster`, params).then(res => res.data)
  }

  /**
   * 获取福利信息
   * @return {Promise}
   */
  getBenefit(params) {
    return request.post(`/api/img/benefit`, params).then(res => res.data)
  }

  /**
   * 获取商圈折扣
   * @return {Promise}
   */
  shopDiscount(params) {
    return request.post(`/api/configure/shopDiscount`, params).then(res => res.data)
  }

  /**
   * 获取拼团详情
   * @return {Promise}
   */
  marketDetail(params) {
    return request.post(`/api/market/detail`, params).then(res => res.data)
  }

  //获取员工列表
  getStaffList(params) {
    return request.post(`/api/shop/shopStaff`, params).then(res => res.data)
  }

  //获取员工详情
  getStaffDetail(params) {
    return request.post(`/api/shop/staffDetail`, params).then(res => res.data)
  }

  //更新用户头像和昵称
  updateAccount(params) {
    return request.post(`/api/account/updateAccount`, params).then(res => res.data)
  }

  //获取图片 2.0
  getImageList(params) {
    return request.post(`/api/img/listByType`, params, false).then(res => res.data)
  }

  //商圈的礼券包列表 2.0
  getMainBagList(params) {
    return request.post(`/api/bag/activityPage`, params).then(res => res.data)
  }

  //商圈历史活动列表
  activityHistoryPage(params) {
    return request.post(`/api/bag/activityHistoryPage`, params).then(res => res.data)
  }

  //首页商圈活动列表 2.0
  shopGroupPage(params) {
    return request.post(`/api/group/shopGroupPage`, params).then(res => res.data)
  }
  //查看礼券包的优惠券详情 2.0
  couponDetail(params) {
    return request.post(`/api/coupon/details`, params).then(res => res.data)
  }
  //查看持有优惠券详情
  couponMyDetail(params) {
    return request.post(`/api/coupon/accountDetails`, params).then(res => res.data)
  }
  //查看赠送礼券包的优惠券详情 2.0
  shareCouponDetail(params) {
    return request.post(`/api/coupon/detail`, params, false).then(res => res.data)
  }

  //领取优惠券 2.0
  receiveCoupon(params) {
    return request.post(`/api/coupon/receiveByCode`, params).then(res => res.data)
  }

  //生成优惠券领取码 2.0
  createCode(params) {
    return request.post(`/api/coupon/createReceiveCode`, params).then(res => res.data)
  }

  //店铺查看用户的优惠券列表 2.0
  getCouponList(params) {
    return request.post(`/api/coupon/myCouponPage`, params).then(res => res.data)
  }

  //用户个人中心信息 (2.0)
  getAccountDetail(params) {
    return request.post(`/api/account/accountDetail`, params).then(res => res.data)
  }
  //用户的券礼包分页列表 2.0
  getBagList(params) {
    return request.post(`/api/bag/accountPage`, params).then(res => res.data)
  }
  //用户赠送好友店铺爆款列表
  getBagGivePage(params) {
    return request.post(`/api/bag/givePage`, params).then(res => res.data)
  }
  //用户赠送好友一卡通优惠券列表
  othersGiveGroupCouponPage(params) {
    return request.post(`/api/coupon/othersGiveGroupCouponPage`, params).then(res => res.data)
  }
  //创建赠送商圈活动的领取码
  createGiveCode(params) {
    return request.post(`/api/bag/createGiveCode`, params).then(res => res.data)
  }

  //用户持有券详情 2.0
  getAccountBagDetail(params) {
    return request.post(`/api/bag/accountBagDetail`, params).then(res => res.data)
  }
  //礼券包详情 2.0
  getActivityDetail(params) {
    return request.post(`/api/bag/activityDetail`, params, false).then(res => res.data)
  }
  //消费/收入 累计(用户端)
  getUserMontyMsg(params) {
    return request.post(`/api/transaction/consumeRecord`, params).then(res => res.data)
  }
  //获取账单
  getTransactionList(params) {
    return request.post(`/api/transaction/shopGroupPage`, params).then(res => res.data)
  }
  //提现
  cashOut(params) {
    return request.post(`/api/withdraw/accountWithdraw`, params).then(res => res.data)
  }
  //获取提现记录
  getCashHistory(params) {
    return request.post(`/api/withdraw/accountPage`, params).then(res => res.data)
  }

  //获取商圈轮播图
  getSwiperImg(params) {
    return request.post(`/api/img/CShopGroupRotationImg`, params).then(res => res.data)
  }

  //生成礼券包订单
  createCouponOrder(params) {
    return request.post(`/api/order/couponOrder`, params).then(res => res.data)
  }

  //获取消息推送 2.0
  getNotice(params) {
    return request.post(`/api/bag/getNotice`, params, false).then(res => res.data)
  }

  //获取我的账户信息
  getAccountMsg(params) {
    return request.post(`/api/transaction/consumeRecordByTypes`, params).then(res => res.data)
  }

  //获取地址详细信息
  getAddressDeatil(params) {
    return request.post(`/api/area/getByLngAndLat`, params, false).then(res => res.data)
  }

  //获取海报图
  getSharePoster(params) {
    return request.post(`/api/share/shareCouponBag`, params).then(res => res.data)
  }

  //获取商圈详情
  getShopCircleDetail(params) {
    return request.post(`/api/group/shopGroupDetail`, params).then(res => res.data)
  }

  //获取所有商圈
  getMyShopCircle(params) {
    return request.post(`/api/group/shopGroupPreview`, params).then(res => res.data)
  }

  //获取商圈中的店铺列表
  getShopCircleShops(params) {
    return request.post(`/api/group/shopList`, params).then(res => res.data)
  }

  //获取店铺爆款列表
  accountPayHotPage(params) {
    return request.post(`/api/bag/accountPayHotPage`, params).then(res => res.data)
  }

  //创建核销店铺爆品的商品二维码 2.0 6.16
  createWriteOffGoodsQrCode(params) {
    return request.post(`/api/share/createWriteOffGoodsQrCode`, params).then(res => res.data)
  }

  //创建核销一卡通的商品二维码 2.0 6.16
  createWriteOffCouponQrCode(params) {
    return request.post(`/api/share/createWriteOffCouponQrCode`, params).then(res => res.data)
  }

  //删除一卡通或者爆品(旧)
  delAccountBag(params) {
    return request.post(`/api/bag/delAccountBag`, params).then(res => res.data)
  }
  //删除一卡通或者爆品()
  delAccountCouponBag(params) {
    return request.post(`/api/bag/delAccountCouponBag`, params).then(res => res.data)
  }
  //核销爆品
  HotBagQrCode(params) {
    return request.post(`/api/share/createWriteOffHotBagQrCode`, params).then(res => res.data)
  }

  //生成拼团订单
  shopGroupPinOrder(params) {
    return request.post(`/api/order/shopGroupPinOrder`, params).then(res => res.data)
  }

  //获取用户可领取红包
  selectTransactionRed(params) {
    return request.post(`/api/red/selectTransactionRed`, params).then(res => res.data)
  }

  //领取待领红包
  giveTransactionRed(params) {
    return request.post(`/api/red/giveTransactionRed`, params).then(res => res.data)
  }

  //获取用户未读拼团
  pinList(params) {
    return request.post(`/api/order/pinList`, params).then(res => res.data)
  }

  //消除拼团成功弹出数据
  readPin(params) {
    return request.post(`/api/order/readPin`, params).then(res => res.data)
  }

  //店铺里面的商圈活动分页列表 729
  shopActivityPage(params) {
    return request.post(`/api/bag/shopActivityPage`, params, false).then(res => res.data)
  }

  //获取省
  areaList(params) {
    return request.post(`/api/area/list`, params).then(res => res.data)
  }

  //根据上级id获取地址
  areaListChild(params) {
    return request.post(`/api/area/selectBySuperId`, params).then(res => res.data)
  }

  //新增用户地址 729
  addAddress(params) {
    return request.post(`/api/address/addAddress`, params).then(res => res.data)
  }
  //修改用户地址 729
  updateAddress(params) {
    return request.post(`/api/address/updateAddress`, params).then(res => res.data)
  }
  //获取地址列表 729
  getAddressList(params) {
    return request.post(`/api/address/list`, params).then(res => res.data)
  }
  //删除地址列表 729
  delAddress(params) {
    return request.post(`/api/address/delAddress`, params).then(res => res.data)
  }

  //获取默认地址 729
  getDefaultAddress(params) {
    return request.post(`/api/address/choice`, params).then(res => res.data)
  }

  //判断是否核销 729
  judgeWriteOff(params) {
    return request.post(`/api/bag/canWriteOff`, params).then(res => res.data)
  }

  //获取红包店铺列表
  getRedBagShopList(params) {
    return request.post(`/api/red/selectShopGroupRed`, params).then(res => res.data)
  }


  //获取店铺红包列表
  getRedbag(params) {
    return request.post(`/api/red/selectShopRed`, params).then(res => res.data)
  }


  //领取店铺红包
  receiveRedBag(params) {
    return request.post(`/api/red/giveShopRed`, params).then(res => res.data)
  }

  //获取商圈用户购买列表
  getUserPayPage(params) {
    return request.post(`/api/bag/payPage`, params, false).then(res => res.data)
  }

  //修改已读
  readNum(params) {
    return request.post(`/api/shop/readNum`, params).then(res => res.data)
  }

  //发布店铺评价
  commentShop(params) {
    return request.post(`/api/comment/commentShop`, params).then(res => res.data)
  }

  //删除评论
  delComment(params) {
    return request.post(`/api/comment/delComment`, params).then(res => res.data)
  }

  //评论类别数目
  commentNum(params) {
    return request.post(`/api/comment/commentNum`, params).then(res => res.data)
  }

  //获取金币账单
  beanPage(params) {
    return request.post(`/api/transaction/beanPage`, params).then(res => res.data)
  }

  //金币提现
  accountWithdrawBean(params) {
    return request.post(`/api/withdraw/accountWithdrawBean`, params).then(res => res.data)
  }

  //生成会员卡商品核销码
  createVipGoodsWriteOffCode(params) {
    return request.post(`/api/share/createVipGoodsWriteOffCode`, params).then(res => res.data)
  }

  //获取交易详情
  getOrderDetail(params) {
    return request.post(`/api/order/orderDetail`, params).then(res => res.data)
  }

  //提交入驻信息
  uploadSettledMsg(params) {
    return request.post(`/api/shop/applyShop`, params).then(res => res.data)
  }


  //生成赠送id
  createGiveId(params) {
    return request.post(`/api/vip/accountSendVip`, params).then(res => res.data)
  }

  //生成赠送二维码
  shareAccountVip(params) {
    return request.post(`/api/share/shareAccountVip`, params).then(res => res.data)
  }

  //领取亲友卡（分享）
  receiveGiveVip(params) {
    return request.post(`/api/vip/receiveGiveVip`, params).then(res => res.data)
  }
  //领取亲友卡(二维码)
  receiveGiveVipByCode(params) {
    return request.post(`/api/vip/receiveGiveVipByCode`, params).then(res => res.data)
  }

  //判断是否直邮到付
  judgePay(params) {
    return request.post(`/api/configure/isOpen`, params).then(res => res.data)
  }

  //注销按钮
  cancellation(params) {
    return request.post(`/api/account/cancellation`, params).then(res => res.data)
  }

  //获取赠送记录列表
  giveHistory(params) {
    return request.post(`/api/vip/giveRecordPage`, params).then(res => res.data)
  }
  //获取核销记录列表
  writeOffHistoryPage(params) {
    return request.post(`/api/bag/writeOffHistoryPage`, params).then(res => res.data)
  }
  //用户赠送好友店铺爆款列表 
  giveHistoryPage(params) {
    return request.post(`/api/bag/givePage`, params).then(res => res.data)
  }
  //用户持有券详情 
  couponBagDetail(params) {
    return request.post(`/api/bag/accountDetail`, params, false).then(res => res.data)
  }

  //根据领取码领取赠送的商圈活动 
  giveByCode(params) {
    return request.post(`/api/bag/giveByCode`, params).then(res => res.data)
  }
  //删除会员店
  delVipShops(params) {
    return request.post(`/api/shop/shopHide`, params).then(res => res.data)
  }

  //获取拼团列表
  getPinList(params) {
    return request.post(`/api/market/marketPage`, params, false).then(res => res.data)
  }

  //根据二维码获取亲友卡(引流卡) 1207
  getByQrCode(params) {
    return request.post(`/api/vip/getByQrCode`, params).then(res => res.data)
  }

  // C端用户申请活动创建
  applyBag(params) {
    return request.post(`/api/bag/applyBag`, params).then(res => res.data)
  }

  // 用户奖励累计金额分页信息
  accountTotalRewardPage(params) {
    return request.post(`/api/bag/accountTotalRewardPage`, params, false).then(res => res.data)
  }

  //生成海报图
  sharePinGoods(params) {
    return request.post(`/api/share/sharePinGoods`, params).then(res => res.data)
  }

  //用户持有的所有商圈活动的数量统计
  myCouponBagNum(params) {
    return request.post(`/api/bag/myCouponBagNum`, params).then(res => res.data)
  }


}
/**
 * 实例化对象
 */
let Controller = new controllerM();
/**
 * 暴露对象，无需每次都加函数名
 */
module.exports = {
  controller: Controller,
}